/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package BoardGameLanguage;

import BoardGameLanguage.facade.BoardGameUtils;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Board</b></em>'.
 * <!-- end-user-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link BoardGameLanguage.Board#getFigures <em>Figures</em>}</li>
 *   <li>{@link BoardGameLanguage.Board#getFields <em>Fields</em>}</li>
 *   <li>{@link BoardGameLanguage.Board#getSelectedFigure <em>Selected Figure</em>}</li>
 *   <li>{@link BoardGameLanguage.Board#getWidth <em>Width</em>}</li>
 *   <li>{@link BoardGameLanguage.Board#getHeight <em>Height</em>}</li>
 * </ul>
 * </p>
 *
 * @see BoardGameLanguage.BoardGameLanguagePackage#getBoard()
 * @model
 * @generated
 */
public interface Board extends EObject {
	/**
	 * Returns the value of the '<em><b>Figures</b></em>' containment reference list.
	 * The list contents are of type {@link BoardGameLanguage.Figure}.
	 * It is bidirectional and its opposite is '{@link BoardGameLanguage.Figure#getBoard <em>Board</em>}'.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Figures</em>' containment reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Figures</em>' containment reference list.
	 * @see BoardGameLanguage.BoardGameLanguagePackage#getBoard_Figures()
	 * @see BoardGameLanguage.Figure#getBoard
	 * @model opposite="board" containment="true"
	 * @generated
	 */
	EList<Figure> getFigures();

	/**
	 * Returns the value of the '<em><b>Fields</b></em>' containment reference list.
	 * The list contents are of type {@link BoardGameLanguage.Field}.
	 * It is bidirectional and its opposite is '{@link BoardGameLanguage.Field#getBoard <em>Board</em>}'.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Fields</em>' containment reference list isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Fields</em>' containment reference list.
	 * @see BoardGameLanguage.BoardGameLanguagePackage#getBoard_Fields()
	 * @see BoardGameLanguage.Field#getBoard
	 * @model opposite="board" containment="true"
	 * @generated
	 */
	EList<Field> getFields();

	/**
	 * Returns the value of the '<em><b>Selected Figure</b></em>' reference.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Selected Figure</em>' reference isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Selected Figure</em>' reference.
	 * @see #setSelectedFigure(Figure)
	 * @see BoardGameLanguage.BoardGameLanguagePackage#getBoard_SelectedFigure()
	 * @model
	 * @generated
	 */
	Figure getSelectedFigure();

	/**
	 * Sets the value of the '{@link BoardGameLanguage.Board#getSelectedFigure <em>Selected Figure</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Selected Figure</em>' reference.
	 * @see #getSelectedFigure()
	 * @generated
	 */
	void setSelectedFigure(Figure value);

	/**
	 * Returns the value of the '<em><b>Width</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Width</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Width</em>' attribute.
	 * @see #setWidth(int)
	 * @see BoardGameLanguage.BoardGameLanguagePackage#getBoard_Width()
	 * @model ordered="false"
	 * @generated
	 */
	int getWidth();

	/**
	 * Sets the value of the '{@link BoardGameLanguage.Board#getWidth <em>Width</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Width</em>' attribute.
	 * @see #getWidth()
	 * @generated
	 */
	void setWidth(int value);

	/**
	 * Returns the value of the '<em><b>Height</b></em>' attribute.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of the '<em>Height</em>' attribute isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @return the value of the '<em>Height</em>' attribute.
	 * @see #setHeight(int)
	 * @see BoardGameLanguage.BoardGameLanguagePackage#getBoard_Height()
	 * @model required="true" ordered="false"
	 * @generated
	 */
	int getHeight();

	/**
	 * Sets the value of the '{@link BoardGameLanguage.Board#getHeight <em>Height</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Height</em>' attribute.
	 * @see #getHeight()
	 * @generated
	 */
	void setHeight(int value);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/BoardGameLanguage#//Board/initialize\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::initialize (utils: BoardGameUtils): void\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.2 \" name=\"\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StatementNode\" outgoing=\"#//@ownedActivityEdge.1 \" incoming=\"#//@ownedActivityEdge.0 \" name=\"create Fields\">\r\n    <statementExpression xsi:type=\"SDMLanguage.calls.callExpressions:MethodCallExpression\" callee=\"http://www.moflon.org/BoardGameLanguage#//facade/BoardGameUtils/createAllFields\">\r\n      <ownedParameterBindings parameter=\"http://www.moflon.org/BoardGameLanguage#//facade/BoardGameUtils/createAllFields/board\">\r\n        <valueExpression xsi:type=\"SDMLanguage.expressions:TextualExpression\" expressionText=\"this\" />\r\n      </ownedParameterBindings>\r\n      <target xsi:type=\"SDMLanguage.calls.callExpressions:ParameterExpression\" parameter=\"http://www.moflon.org/BoardGameLanguage#//Board/initialize/utils\" />\r\n    </statementExpression>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.2\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"true\" outgoing=\"#//@ownedActivityEdge.2 #//@ownedActivityEdge.3 \" incoming=\"#//@ownedActivityEdge.1 #//@ownedActivityEdge.4 \" name=\"iterate over Fields\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.0\" name=\"fields\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"END\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityEdge guard=\"EACH_TIME\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.4 \" incoming=\"#//@ownedActivityEdge.3 \" name=\"connect current Field\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.5 \" incomingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.0 \" name=\"above\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/column\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.0\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/column\" object=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/row\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.0\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"field.getRow() - 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.0\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.1\" name=\"above\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.0 #//@ownedActivityNode.4/@storyPattern/@linkVariable.2 #//@ownedActivityNode.4/@storyPattern/@linkVariable.3 \" incomingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.1 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Field\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.4\" name=\"left\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.6 \" incomingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.2 \" name=\"below\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/column\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.2\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/column\" object=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/row\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.2\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"field.getRow() + 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.2\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.1\" name=\"below\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.4 \" incomingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.3 \" name=\"left\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/row\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.3\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/row\" object=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/column\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.3\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"field.getColumn() - 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.3\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.1\" name=\"left\" />\r\n      <objectVariable bindingSemantics=\"OPTIONAL\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" outgoingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.1 #//@ownedActivityNode.4/@storyPattern/@linkVariable.7 \" name=\"right\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Field\">\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/row\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.4\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/row\" object=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n        <constraint>\r\n          <constraintExpression xsi:type=\"SDMLanguage.expressions:ComparisonExpression\" operator=\"EQUAL\">\r\n            <leftExpression xsi:type=\"SDMLanguage.patterns.patternExpressions:AttributeValueExpression\" attribute=\"http://www.moflon.org/BoardGameLanguage#//Field/column\" object=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.4\" />\r\n            <rightExpression xsi:type=\"SDMLanguage.expressions:LiteralExpression\" type=\"\" value=\"field.getColumn() + 1\" />\r\n          </constraintExpression>\r\n        </constraint>\r\n      </objectVariable>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.4/@storyPattern/@linkVariable.4 #//@ownedActivityNode.4/@storyPattern/@linkVariable.5 #//@ownedActivityNode.4/@storyPattern/@linkVariable.6 #//@ownedActivityNode.4/@storyPattern/@linkVariable.7 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Board\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.5\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.3\" name=\"board\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.5\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.0\" name=\"board\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.5\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.2\" name=\"board\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.5\" source=\"#//@ownedActivityNode.4/@storyPattern/@objectVariable.4\" name=\"board\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.4\" />\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n      Iterator fujaba__IterThisToAbove = null;\n      Field above = null;\n      Iterator fujaba__IterThisToBelow = null;\n      Field below = null;\n      Iterator fujaba__IterThisToLeft = null;\n      Field left = null;\n      Iterator fujaba__IterThisToRight = null;\n      Field right = null;\n      Iterator fujaba__IterThisToField = null;\n      Field field = null;\n\n      utils.createAllFields(this);\n      // story pattern iterate over Fields\n      try \n      {\n         fujaba__Success = false; \n\n         // iterate to-many link fields from this to field\n         fujaba__Success = false;\n\n         fujaba__IterThisToField = new ArrayList(this.getFields()).iterator ();\n\n         while ( fujaba__IterThisToField.hasNext () )\n         {\n            try\n            {\n               field = (Field) fujaba__IterThisToField.next ();\n\n               // check object field is really bound\n               JavaSDM.ensure ( field != null );\n               // story pattern connect current Field\n               try \n               {\n                  fujaba__Success = false; \n\n                  // check object field is really bound\n                  JavaSDM.ensure ( field != null );\n                  // iterate to-many link fields from this to above\n                  fujaba__Success = false;\n\n                  fujaba__IterThisToAbove = this.getFields().iterator ();\n\n                  while ( !(fujaba__Success) && fujaba__IterThisToAbove.hasNext () )\n                  {\n                     try\n                     {\n                        above = (Field) fujaba__IterThisToAbove.next ();\n\n                        // check optional\n                        if (above != null)\n                        {\n                           // check isomorphic binding between objects above and field\n                           JavaSDM.ensure ( !above.equals (field) );\n\n                           // attribute condition\n                           JavaSDM.ensure ( above.getColumn () == field.getColumn() );\n\n                           // attribute condition\n                           JavaSDM.ensure ( above.getRow () == field.getRow() - 1 );\n\n                        }\n                        fujaba__Success = true;\n                     }\n                     catch ( JavaSDMException fujaba__InternalException )\n                     {\n                        fujaba__Success = false;\n                     }\n                  }\n                  if (!fujaba__Success)\n                  {\n                     fujaba__Success = true;\n                     above = null;\n                  }\n                  // iterate to-many link fields from this to below\n                  fujaba__Success = false;\n\n                  fujaba__IterThisToBelow = this.getFields().iterator ();\n\n                  while ( !(fujaba__Success) && fujaba__IterThisToBelow.hasNext () )\n                  {\n                     try\n                     {\n                        below = (Field) fujaba__IterThisToBelow.next ();\n\n                        // check optional\n                        if (below != null)\n                        {\n                           // check isomorphic binding between objects below and field\n                           JavaSDM.ensure ( !below.equals (field) );\n\n                           // attribute condition\n                           JavaSDM.ensure ( below.getColumn () == field.getColumn() );\n\n                           // attribute condition\n                           JavaSDM.ensure ( below.getRow () == field.getRow() + 1 );\n\n                        }\n                        fujaba__Success = true;\n                     }\n                     catch ( JavaSDMException fujaba__InternalException )\n                     {\n                        fujaba__Success = false;\n                     }\n                  }\n                  if (!fujaba__Success)\n                  {\n                     fujaba__Success = true;\n                     below = null;\n                  }\n                  // iterate to-many link fields from this to left\n                  fujaba__Success = false;\n\n                  fujaba__IterThisToLeft = this.getFields().iterator ();\n\n                  while ( !(fujaba__Success) && fujaba__IterThisToLeft.hasNext () )\n                  {\n                     try\n                     {\n                        left = (Field) fujaba__IterThisToLeft.next ();\n\n                        // check optional\n                        if (left != null)\n                        {\n                           // check isomorphic binding between objects left and field\n                           JavaSDM.ensure ( !left.equals (field) );\n\n                           // attribute condition\n                           JavaSDM.ensure ( left.getColumn () == field.getColumn() - 1 );\n\n                           // attribute condition\n                           JavaSDM.ensure ( left.getRow () == field.getRow() );\n\n                        }\n                        fujaba__Success = true;\n                     }\n                     catch ( JavaSDMException fujaba__InternalException )\n                     {\n                        fujaba__Success = false;\n                     }\n                  }\n                  if (!fujaba__Success)\n                  {\n                     fujaba__Success = true;\n                     left = null;\n                  }\n                  // iterate to-many link fields from this to right\n                  fujaba__Success = false;\n\n                  fujaba__IterThisToRight = this.getFields().iterator ();\n\n                  while ( !(fujaba__Success) && fujaba__IterThisToRight.hasNext () )\n                  {\n                     try\n                     {\n                        right = (Field) fujaba__IterThisToRight.next ();\n\n                        // check optional\n                        if (right != null)\n                        {\n                           // check isomorphic binding between objects right and field\n                           JavaSDM.ensure ( !right.equals (field) );\n\n                           // attribute condition\n                           JavaSDM.ensure ( right.getColumn () == field.getColumn() + 1 );\n\n                           // attribute condition\n                           JavaSDM.ensure ( right.getRow () == field.getRow() );\n\n                        }\n                        fujaba__Success = true;\n                     }\n                     catch ( JavaSDMException fujaba__InternalException )\n                     {\n                        fujaba__Success = false;\n                     }\n                  }\n                  if (!fujaba__Success)\n                  {\n                     fujaba__Success = true;\n                     right = null;\n                  }\n                  // check optional\n                  if (above != null)\n                  {\n                     // create link\n                     field.setAbove( above);\n\n                  }// check optional\n                  if (left != null)\n                  {\n                     // create link\n                     left.setRight( field);\n\n                  }// check optional\n                  if (below != null)\n                  {\n                     // create link\n                     below.setAbove( field);\n\n                  }// check optional\n                  if (right != null)\n                  {\n                     // create link\n                     right.setLeft( field);\n\n                  }   fujaba__Success = true;\n               }\n               catch ( JavaSDMException fujaba__InternalException )\n               {\n                  fujaba__Success = false;\n               }\n\n\n               fujaba__Success = true;\n            }\n            catch ( JavaSDMException fujaba__InternalException )\n            {\n               fujaba__Success = false;\n            }\n         }\n         JavaSDM.ensure (fujaba__Success);\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n      return ;'"
	 * @generated
	 */
	void initialize(BoardGameUtils utils);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @model annotation="SDM XMI='<?xml version=\"1.0\" encoding=\"ASCII\"?>\r\n<SDMLanguage.activities:Activity xmlns:xmi=\"http://www.omg.org/XMI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ecore=\"http://www.eclipse.org/emf/2002/Ecore\" xmlns:SDMLanguage.activities=\"http://www.moflon.org/SDMLanguage.activities\" xmlns:SDMLanguage.expressions=\"http://www.moflon.org/SDMLanguage.expressions\" xmlns:SDMLanguage.patterns=\"http://www.moflon.org/SDMLanguage.patterns\" xmlns:SDMLanguage.patterns.patternExpressions=\"http://www.moflon.org/SDMLanguage.patterns.patternExpressions\" xmlns:SDMLanguage.calls.callExpressions=\"http://www.moflon.org/SDMLanguage.calls.callExpressions\" xmlns:SDMLanguage.calls=\"http://www.moflon.org/SDMLanguage.calls\" xsi:schemaLocation=\"http://www.moflon.org/SDMLanguage.activities SDMLanguage.ecore#//activities http://www.moflon.org/SDMLanguage.patterns SDMLanguage.ecore#//patterns\" owningOperation=\"http://www.moflon.org/BoardGameLanguage#//Board/handleFieldPressed\">\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StartNode\" outgoing=\"#//@ownedActivityEdge.0 \" name=\"Board::handleFieldPressed (field: Field): void\" />\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.1\" source=\"#//@ownedActivityNode.0\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.1 #//@ownedActivityEdge.2 \" incoming=\"#//@ownedActivityEdge.0 \" name=\"check whether field is occupied\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"field\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Field\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.1/@storyPattern/@linkVariable.0 \" name=\"figureOnField\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Figure\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.1/@storyPattern/@objectVariable.0\" name=\"figure\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"SUCCESS\" target=\"#//@ownedActivityNode.2\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityEdge guard=\"FAILURE\" target=\"#//@ownedActivityNode.3\" source=\"#//@ownedActivityNode.1\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.3 \" incoming=\"#//@ownedActivityEdge.1 \" name=\"select figure/change selection\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.2/@storyPattern/@linkVariable.0 \" name=\"figureOnField\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Figure\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CREATE\" target=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.2/@storyPattern/@objectVariable.0\" name=\"selectedFigure\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.2\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.4 #//@ownedActivityEdge.5 \" incoming=\"#//@ownedActivityEdge.2 \" name=\"is there a selected figure?\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"UNBOUND\" incomingLink=\"#//@ownedActivityNode.3/@storyPattern/@linkVariable.0 \" name=\"selectedFigure\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Figure\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" target=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.3/@storyPattern/@objectVariable.0\" name=\"selectedFigure\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"SUCCESS\" target=\"#//@ownedActivityNode.5\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityEdge guard=\"FAILURE\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.3\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StopNode\" incoming=\"#//@ownedActivityEdge.3 #//@ownedActivityEdge.5 #//@ownedActivityEdge.7 \" name=\"\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StatementNode\" outgoing=\"#//@ownedActivityEdge.6 \" incoming=\"#//@ownedActivityEdge.4 \" name=\"move figure\">\r\n    <statementExpression xsi:type=\"SDMLanguage.calls.callExpressions:MethodCallExpression\" callee=\"http://www.moflon.org/BoardGameLanguage#//Figure/move\">\r\n      <ownedParameterBindings parameter=\"http://www.moflon.org/BoardGameLanguage#//Figure/move/targetField\">\r\n        <valueExpression xsi:type=\"SDMLanguage.expressions:TextualExpression\" expressionText=\"field\" />\r\n      </ownedParameterBindings>\r\n      <target xsi:type=\"SDMLanguage.patterns.patternExpressions:ObjectVariableExpression\" object=\"#//@ownedActivityNode.6/@storyPattern/@objectVariable.1\" />\r\n    </statementExpression>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.6\" source=\"#//@ownedActivityNode.5\" />\r\n  <ownedActivityNode xsi:type=\"SDMLanguage.activities:StoryNode\" forEach=\"false\" outgoing=\"#//@ownedActivityEdge.7 \" incoming=\"#//@ownedActivityEdge.6 \" name=\"unselect figure\">\r\n    <storyPattern>\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" outgoingLink=\"#//@ownedActivityNode.6/@storyPattern/@linkVariable.0 \" name=\"this\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Board\" />\r\n      <objectVariable bindingSemantics=\"MANDATORY\" bindingOperator=\"CHECK_ONLY\" bindingState=\"BOUND\" incomingLink=\"#//@ownedActivityNode.6/@storyPattern/@linkVariable.0 \" name=\"selectedFigure\" type=\"ecore:EClass http://www.moflon.org/BoardGameLanguage#//Figure\" />\r\n      <linkVariable xsi:type=\"SDMLanguage.patterns:LinkVariable\" bindingSemantics=\"MANDATORY\" bindingOperator=\"DESTROY\" target=\"#//@ownedActivityNode.6/@storyPattern/@objectVariable.1\" source=\"#//@ownedActivityNode.6/@storyPattern/@objectVariable.0\" name=\"selectedFigure\" />\r\n    </storyPattern>\r\n  </ownedActivityNode>\r\n  <ownedActivityEdge guard=\"NONE\" target=\"#//@ownedActivityNode.4\" source=\"#//@ownedActivityNode.6\" />\r\n</SDMLanguage.activities:Activity>'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='boolean fujaba__Success = false;\n      Figure figureOnField = null;\n      Figure selectedFigure = null;\n\n      // story pattern check whether field is occupied\n      try \n      {\n         fujaba__Success = false; \n\n         // check object field is really bound\n         JavaSDM.ensure ( field != null );\n         // bind object\n         figureOnField = field.getFigure ();\n\n         // check object figureOnField is really bound\n         JavaSDM.ensure ( figureOnField != null );\n\n\n         fujaba__Success = true;\n      }\n      catch ( JavaSDMException fujaba__InternalException )\n      {\n         fujaba__Success = false;\n      }\n\n      if (fujaba__Success)\n      {\n         // story pattern select figure/change selection\n         try \n         {\n            fujaba__Success = false; \n\n            // check object figureOnField is really bound\n            JavaSDM.ensure ( figureOnField != null );\n            // create link\n            org.moflon.util.eMoflonEMFUtil.addOppositeReference(this,figureOnField,\"selectedFigure\");\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n\n      }\n      else\n      {\n         // story pattern is there a selected figure?\n         try \n         {\n            fujaba__Success = false; \n\n            // bind object\n            selectedFigure = this.getSelectedFigure ();\n\n            // check object selectedFigure is really bound\n            JavaSDM.ensure ( selectedFigure != null );\n\n\n            fujaba__Success = true;\n         }\n         catch ( JavaSDMException fujaba__InternalException )\n         {\n            fujaba__Success = false;\n         }\n\n         if (fujaba__Success)\n         {\n            selectedFigure.move(field);\n            // story pattern unselect figure\n            try \n            {\n               fujaba__Success = false; \n\n               // check object selectedFigure is really bound\n               JavaSDM.ensure ( selectedFigure != null );\n               // check link selectedFigure from this to selectedFigure\n               JavaSDM.ensure (selectedFigure.equals (this.getSelectedFigure ()));\n\n               // destroy link\n               org.moflon.util.eMoflonEMFUtil.removeOppositeReference(this,selectedFigure,\"selectedFigure\");\n               fujaba__Success = true;\n            }\n            catch ( JavaSDMException fujaba__InternalException )\n            {\n               fujaba__Success = false;\n            }\n\n\n         }\n         else\n         {\n\n         }\n\n      }\n      return ;'"
	 * @generated
	 */
	void handleFieldPressed(Field field);

} // Board
